package com.ymatou.iapi.productmanager.testcase;

import com.ymatou.iapi.productmanager.parameter.SkuStockDto;
import com.ymatou.iapi.productmanager.parameter.product.AddSellerProductRequest;
import com.ymatou.iapi.productmanager.parameter.product.CatalogSaveModel;
import com.ymatou.iapi.productmanager.service.UpdateStockBySkuCall;
import com.ymatou.iapi.sellerproduct.parameter.SKUPriceBean;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.ProductManagerCallServiceV2;
import com.ymttest.database.annotation.SqlMapperFactory;
import com.ymttest.database.model.YmtCatalogsI;
import com.ymttest.database.sqlwapper.YmtCatalogsIWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.*;
import org.junit.experimental.categories.Category;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Ts_UpdateStockBySku {
	public static UpdateStockBySkuCall updateStockBySkuCall = new UpdateStockBySkuCall();
	private static Integer sellerId = Integer.valueOf(EnvSetup.getData("productsellerid"));
	private static YmtCatalogsIWapper ymtCatalogsIWapper = new YmtCatalogsIWapper();
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("商品改规格库存");
		//SqlMapperFactory.getIntergratedProductMapper().updateProductoffSale(sellerId);
	}
	
	@Before
	public void caseUp() {

	}
	
	@AfterClass
	public static void tearDown() {
		Logger.generateResult(updateStockBySkuCall.getOpurl());
	}
	
	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_001_001() {
		Logger.start(true,"修改多个库存，部分按sku，部分按catalogId" );
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			for(int i=0;i<6;i++){
				addProdReq.getProduct().getCatalogList().add(ProductManagerCallServiceV2.initCatalogSaveModel(10d,10,"颜色","颜色"+i));
			}
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			
			String productId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId);
			
			//前四个用catalogid update 后四个用sku
			List<SkuStockDto> skuStockList = new ArrayList<>();
			for (int i=0;i<skuList.size();i++){
				SkuStockDto skuStockDto = new SkuStockDto();
				if (i<(skuList.size()/2)){
					@SuppressWarnings("rawtypes")
					Map catalogInSql = ymtCatalogsIWapper.selectProductIdBySku(skuList.get(i)).get(0);
					skuStockDto.setCatalogId(catalogInSql.get("sCatalogId").toString());
				}else{
					skuStockDto.setSkuId(skuList.get(i));
				}
				
				skuStockList.add(skuStockDto);
			}

			//修改stock
			generateBeanSKUStock(skuStockList);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuStockList);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuStockList);
			
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_001() {
		Logger.start(true,"修改多个SKU的库存 ");
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			
			for(int i=0;i<6;i++){
				addProdReq.getProduct().getCatalogList().add(ProductManagerCallServiceV2.initCatalogSaveModel(10d,10,"颜色","颜色"+i));
			}
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			
			//修改stock
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
			
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_002() {
		Logger.start(true,"修改相同SKU的库存");
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			
			String productId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId);
			
			
			String productId2 = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId2);
			
			
			//修改stock
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			int stock = Integer.parseInt(skuAndStockMap.get(skuList.get(0)).toString());
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			
			YmtCatalogsIWapper ymtCatalogsIWapper = new YmtCatalogsIWapper();
			List<Map> retList = ymtCatalogsIWapper.selectProductIdBySku(skuList.get(0));
			
			Map<String,Object> ret1 = retList.get(0);
			Map<String,Object> ret2 = retList.get(1);
			int actStockInSql1 = Integer.parseInt(ret1.get("iNum").toString());
			int actStockInSql2 = Integer.parseInt(ret2.get("iNum").toString());
			Logger.debug(retList);
			
			Logger.verifyEquals(true , ((actStockInSql1==stock)&&(actStockInSql2!=stock))||((actStockInSql1!=stock)&&(actStockInSql2==stock)), "SKU: " +skuList.get(0)+ ",只能修改一个对应的SKU" );
			
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_003() {
		Logger.start(true,"一次性修改超过51个SKU的库存,修改失败");
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			
			for(int i=0;i<40;i++){
				addProdReq.getProduct().getCatalogList().add(ProductManagerCallServiceV2.initCatalogSaveModel(10d,10,"颜色","颜色"+i));
			}
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			
			String productId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			
			
			//发布商品 带SKU
			Logger.comment("ProductId: " + productId);
			
			//修改stock
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
			
			//设置11个skulist
			List<String> new_skuList = generateSKUList(11);
			new_skuList.addAll(skuList);
			Map<String,Object> skuAndStockMap1 = generateSKUStock(new_skuList);
			JSONObject retBean1 = updateStockBySkuCall.update(sellerId, skuAndStockMap1);
			Logger.verifyEquals(400, retBean1.getInt("Code"), "返回code检查");
			
			//超过11个，修改失败，所以第一次修改的库存没有变化
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
			
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_004() {
		Logger.start(true,"修改非该买手SKU的库存");
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			
			String productId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId);
			
			//正常修改stock
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);

			//非该买手 修改stock
			Map<String,Object> skuAndStockMap2 = generateSKUStock(skuList);
			JSONObject retBean2 = updateStockBySkuCall.update(12312, skuAndStockMap2);
			Logger.verifyEquals(200, retBean2.getInt("Code"), "返回code检查");
			JSONArray SkuResults = retBean2.getJSONObject("Data").getJSONArray("SkuResults");
			for (int i=0;i<SkuResults.length();i++){
				Logger.verifyEquals(false,SkuResults.getJSONObject(i).getBoolean("ExecSuccess"),"SKU:"+SkuResults.getJSONObject(i).getString("SkuId")+" 应修改失败");
			}

			//非该买手修改失败，所以第一次修改的库存没有变化
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);

		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	@Test
	@Ignore
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_005() {
		Logger.start(true,"SKU库存值 不为数字");
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			
			String productId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId);

			//修改stock
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
			
			//修改stock为String
			Map<String,Object> retMap = new HashMap<>();
			skuList.forEach(ele->{
				retMap.put(ele, "ssss");
				Logger.comment("SKU: "+ ele+", stock: "+"ssss" );
			});
			
			JSONObject retBean1 = updateStockBySkuCall.update(sellerId, retMap);
			Logger.verifyEquals(200, retBean1.getInt("Code"), "返回code检查");
			
			//stock非数字，所以都变为0
			skuAndStockMap.forEach((x,y)->{
				skuAndStockMap.put(x, 0);
			});
			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
			
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_006() {
		Logger.start(true,"修改不存在的SKU");
		try{
			List<String> skuList = generateSKUList(8);
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);

			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			
			JSONArray SkuResults = retBean.getJSONObject("Data").getJSONArray("SkuResults");
			for (int i=0;i<SkuResults.length();i++){
				Logger.verifyEquals(false,SkuResults.getJSONObject(i).getBoolean("ExecSuccess"),"SKU:"+SkuResults.getJSONObject(i).getString("SkuId")+" 应修改失败");
			}
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_007() {
		Logger.start(true,"修改部分存在，部分不存在的SKU");
		try{
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			List<String> skuList = generateSKUList(addProdReq.getProduct().getCatalogList().size());
			for (int i=0;i<addProdReq.getProduct().getCatalogList().size();i++){
				String sku=skuList.get(i);
				addProdReq.getProduct().getCatalogList().get(i).setSku(sku);
			}
			
			String productId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId);
			
			List<String> skuList2 = generateSKUList(4);

			//正常修改 部分存在，部分不存在SKU
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			Map<String,Object> skuAndStockMap2 = generateSKUStock(skuList2);
			skuAndStockMap2.putAll(skuAndStockMap);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap2);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			JSONArray SkuResults = retBean.getJSONObject("Data").getJSONArray("SkuResults");
			for(int i=0;i<SkuResults.length();i++){
				if (skuList2.contains(SkuResults.getJSONObject(i).getString("SkuId"))){
					Logger.verifyEquals(false,SkuResults.getJSONObject(i).getBoolean("ExecSuccess"),"SKU:"+SkuResults.getJSONObject(i).getString("SkuId")+" 应修改失败");
				}
			}

			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdateStockBySku_008() {
		Logger.start(true,"修改已删除商品sku,失败");
		try{
			AddSellerProductRequest addpro = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			List<String> skuList = new ArrayList<>();
			List<CatalogSaveModel> clist = addpro.getProduct().getCatalogList();
			for (int i=0;i<clist.size();i++){
				String sku="SKU"+TestDataManager.getRandomIntNum(10);
				skuList.add(sku);
				clist.get(i).setSku(sku);
			}
			String productId = ProductManagerCallServiceV2.addNewProduct(addpro).get("Data").getAsJsonObject().get("ProductId").getAsString();
			Logger.comment("ProductId: " + productId);
			ProductManagerCallServiceV2.updateProductAction( productId,-1);
			
			//修改stock
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			JSONArray SkuResults = retBean.getJSONObject("Data").getJSONArray("SkuResults");
			for(int i=0;i<SkuResults.length();i++){
				if (skuList.contains(SkuResults.getJSONObject(i).getString("SkuId"))){
					Logger.verifyEquals(false,SkuResults.getJSONObject(i).getBoolean("ExecSuccess"),"SKU:"+SkuResults.getJSONObject(i).getString("SkuId")+" 验证ExecSuccessfalse");
					Logger.verifyEquals("已删除的商品无法更新库存",SkuResults.getJSONObject(i).getString("Msg"),"SKU:"+SkuResults.getJSONObject(i).getString("Msg")+" 已删除的商品无法更新库存");
				}
			}
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_UpdatePriceBySku_009() {
		Logger.start(true,"通过sku修改商品库存时，过滤被删除的商品");
		try{
			AddSellerProductRequest addpro = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
			List<String> skuList = new ArrayList<>();
			List<CatalogSaveModel> clist = addpro.getProduct().getCatalogList();
			for (int i=0;i<clist.size();i++){
				String sku="SKU"+TestDataManager.getRandomIntNum(10);
				skuList.add(sku);
				clist.get(i).setSku(sku);
			}
			String productId = ProductManagerCallServiceV2.addNewProduct(addpro).get("Data").getAsJsonObject().get("ProductId").getAsString();
			String productId1 = ProductManagerCallServiceV2.addNewProduct(addpro).get("Data").getAsJsonObject().get("ProductId").getAsString();
			ProductManagerCallServiceV2.updateProductAction( productId,-1);
			//===============================================================================================================
			//只改原价
			Map<String,Object> skuAndStockMap = generateSKUStock(skuList);
			
			JSONObject retBean = updateStockBySkuCall.update(sellerId, skuAndStockMap);
			Logger.verifyEquals(200, retBean.getInt("Code"), "返回code检查");
			JSONArray SkuResults = retBean.getJSONObject("Data").getJSONArray("SkuResults");
			for(int i=0;i<SkuResults.length();i++){
				if (skuList.contains(SkuResults.getJSONObject(i).getString("SkuId"))){
					Logger.verifyEquals(true,SkuResults.getJSONObject(i).getBoolean("ExecSuccess"),"SKU:"+SkuResults.getJSONObject(i).getString("SkuId")+" 验证ExecSuccessfalse");
					Logger.verifyEquals("成功",SkuResults.getJSONObject(i).getString("Msg"),"SKU:"+SkuResults.getJSONObject(i).getString("Msg")+" 已删除的商品无法更新库存");
				}
			}
			
			List<Map> retList = ymtCatalogsIWapper.selectProductIdBySku(skuList.get(0));
			Logger.verifyNotEquals(retList.get(0).get("iNum"), retList.get(1).get("iNum"), "已删除的商品和未删除的商品，库存不同");
			
			System.out.println(retList);
//			checkStockBySku(retBean.getJSONObject("Data").getJSONArray("SkuResults"),skuAndStockMap);
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
	public static List<String> generateSKUList(int num){
		List<String> skuList = new ArrayList<>();
		for (int i=0;i<num;i++){
			skuList.add("SKU"+TestDataManager.getRandomIntNum(10));
		}
		return skuList;
	}

	public static Map<String,Object> generateSKUStock(List<String> skuList){
		Map<String,Object> retMap = new HashMap<>();
		skuList.forEach(ele->{
			int stock = TestDataManager.getRandomIntNum(2);
			retMap.put(ele, stock);
			Logger.comment("SKU: "+ ele+", stock: "+stock );
		});
		return retMap;
	}
	
	public static List<SkuStockDto> generateBeanSKUStock(List<SkuStockDto> skuList){
		skuList.forEach(ele->{
			int stock = TestDataManager.getRandomIntNum(2);
			ele.setNum(stock);
			Logger.comment(ele.getCatalogId()+","+ ele.getSkuId()+", stock: "+stock );
		});
		return skuList;
	}

	public static void setSkuForAddProduct(List<String> skuList,JSONObject addProdRequest) throws JSONException{
		JSONArray catalogAry = addProdRequest.getJSONObject("Product").getJSONArray("Catalogs");
		int minNum = Math.min(skuList.size(),catalogAry.length());
		for(int i=0;i<minNum;i++){
			catalogAry.getJSONObject(i).put("SKU", skuList.get(i));
		}
	}

	public static void checkStockBySku(JSONArray skuResults, Map<String,Object> skuIdandStockMap)throws Exception{
		List<SkuStockDto> skuStockList = new ArrayList<>();
		for(String skuId:skuIdandStockMap.keySet()){
			SkuStockDto skuStockDto = new SkuStockDto();
			skuStockDto.setSkuId(skuId);
			skuStockDto.setNum((Integer)skuIdandStockMap.get(skuId));
			skuStockList.add(skuStockDto);
		}
		checkStockBySku(skuResults,skuStockList);
	}
	
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static void checkStockBySku(JSONArray skuResults, List<SkuStockDto> skuStockDtoList) throws Exception{
		YmtCatalogsIWapper ymtCatalogsIWapper = new YmtCatalogsIWapper();

		for (SkuStockDto skuStockDto : skuStockDtoList ){
			String reqSku = String.valueOf(skuStockDto.getSkuId());
			String reqCatalogId = String.valueOf(skuStockDto.getCatalogId());
			
			//返回报文检查
			//boolean isFoundInRet = false;
			for(int j=0;j<skuResults.length();j++){
				if (skuResults.getJSONObject(j).getString("SkuId").equals(reqSku)
						||(!reqCatalogId.equals("null")&&reqCatalogId!=null&&skuResults.getJSONObject(j).getString("CatalogId").equals(reqCatalogId))){
					Logger.verifyEquals(true, skuResults.getJSONObject(j).getBoolean("ExecSuccess"), "ExecSuccess 返回报文检查");
					//isFoundInRet = true;
					break;
				}
			}
			//Logger.verifyEquals(true, isFoundInRet, "SKU or catalogId:"+reqSku+","+reqCatalogId+",在返回报文中是否存在");
			
			//期待库存
			int tgtStock = skuStockDto.getNum();

			String catalogId;
			int actStockInSql;
			
			if (reqCatalogId!=null&&!reqCatalogId.equals("null")){
				YmtCatalogsI ele = ymtCatalogsIWapper.selectCatalogsByCatalogId(reqCatalogId);
				catalogId = ele.getsCatalogId();
				actStockInSql = ele.getiNum();
				
			}else{
				List<Map> retList = ymtCatalogsIWapper.selectProductIdBySku(reqSku);
				Logger.verifyEquals(1, retList.size(), "SKU:"+reqSku+", 应该只有一个对应的catalog");
				Map<String,Object> ret = retList.get(0);
				catalogId = ret.get("sCatalogId").toString();
				actStockInSql = Integer.parseInt(ret.get("iNum").toString());
			}

			//sql
			Logger.verifyEquals(tgtStock, actStockInSql, "sql中库存检查 catalogId:"+catalogId);

		}
	}
}

